class LogB<T> {
    // Static members cannot reference class type parameters.
    // static run(value: T) {
    run(value: T) {
        console.log(value)
        return value
    }
}

let log1 = new LogB<number>()
log1.run(1)
let log2 = new LogB<any>();
let obj01 = {a:1}
log2.run(obj01)
log2.run('2')
log2.run(2.15)


// function log<T>(value: T) : T {
//     // Property 'length' does not exist on type 'T'.
//     console.log(value, value.length)
//     return value
// }

interface Length {
    length: number
}

function loog<T extends Length>(value: T) : T {
    console.log(value, value.length)
    return value
}

loog('123111')
loog([1, 2, 3])
loog({length: 1})
// loog(1)





